package ee.smkv.Badminton_score_counter;

import com.sonyericsson.extras.liveware.extension.util.ExtensionService;
import com.sonyericsson.extras.liveware.extension.util.control.ControlExtension;
import com.sonyericsson.extras.liveware.extension.util.registration.DeviceInfoHelper;
import com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInformation;

public class ReceiverService extends ExtensionService {
    public static final String EXTENSION_KEY = ReceiverService.class.getPackage().getName();

    @Override
    protected RegistrationInformation getRegistrationInformation() {
        return new BadmintonScoreCounterRegistrationInformation(this);
    }

    @Override
    protected boolean keepRunningWhenConnected() {
        return false;
    }

    @Override
    public ControlExtension createControlExtension(String hostAppPackageName) {//возвращаем объект основной программы

        boolean advancedFeaturesSupported = DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected(
                this, hostAppPackageName);
        if (advancedFeaturesSupported) {
            return new BadmintonScoreCounterControlExtension(this , hostAppPackageName);
        } else {
            throw new IllegalArgumentException("No control for: " + hostAppPackageName);
        }

    }




}
